package business.article.entities;

import article.entities.CategoryVO;

public class Category {

	private String cat;
	private int primaryKey;

	public String getCat() {
		return cat;
	}

	public Category(String cat) {
		this.cat = cat;
	}
	
	public String toString(){
		return cat;
	}

	public int getPrimaryKey() {
		return primaryKey;
	}

	public void setPrimaryKey(int primaryKey) {
		this.primaryKey = primaryKey;
	}

	public Category(String cat, int primaryKey) {
		this.cat = cat;
		this.primaryKey = primaryKey;
	}

	public Category(CategoryVO cat2) {
		if(cat2!=null){
			this.cat = cat2.getCat();
			this.primaryKey = cat2.getPrimaryKey();
		}else{
			this.cat = null;
			this.primaryKey=0;
		}		
	}
	
	public CategoryVO toVO(){
		return new CategoryVO(this.cat, this.primaryKey);
	}
}
